﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="../src/utilFn.js"></script>
    <script src="../utilPackage/jquery-1.11.3.min.js"></script>
    <link href="../utilPackage/utilFn.css" rel="stylesheet" />
</head>
<body>
    <div class="subPage">
        <div class="subPage-title">
            时间处理常用的方法
        </div>
        <div class="subPage-sub-title">
            输入字符串和时间对象都可以，方法会自动判断转为时间对象
        </div>
        <div id="toDate" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>toDate</strong> </span> <span class="title-type">Function(String,Number)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">              </span><span class="com">//*-------------------将字符串String转为时间Date ---//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2000-10-12 12:14:30'</span><span class="pun">);</span><span class="com">//将字符串转为时间</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="com">//str1是Thu Oct 12 2000 12:14:30 GMT+0800 (中国标准时间)</span></code></li><li class="L6"><code class="lang-javascript"></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2000/10/12 12:14:30'</span><span class="pun">);</span><span class="com">//将字符串转为时间</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="com">//str1是Thu Oct 12 2000 12:14:30 GMT+0800 (中国标准时间)</span></code></li><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如3：    </span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'\/Date(-62135596800000)\/'</span><span class="pun">,</span><span class="pln"> </span><span class="lit">2</span><span class="pun">);</span><span class="com">//将字符串转为时间</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="com">//str1是Mon Jan 01    1 08:00:00 GMT+0800 (中国标准时间)</span></code></li><li class="L4"><code class="lang-javascript"></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如4：</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="pln">\/</span><span class="typ">Date</span><span class="pun">(</span><span class="lit">62135596800000</span><span class="pun">)</span><span class="pln">\/</span><span class="pun">,</span><span class="pln"> </span><span class="lit">2</span><span class="pun">);</span><span class="com">//将字符串转为时间</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="com">//str1是Sun Jan 01 3939 08:00:00 GMT+0800 (中国标准时间)</span></code></li><li class="L8"><code class="lang-javascript"></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如5：</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'6954546654654'</span><span class="pun">,</span><span class="pln"> </span><span class="lit">2</span><span class="pun">);</span><span class="com">//将字符串转为时间</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="com">//str1是Wed May 19 2190 18:30:54 GMT+0800 (中国标准时间)</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.toDate(String,Number)<br />
                    //将字符串转化为时间 Number参数默认为1<br />
                    //Number为1代表的是格式<br />
                    //Number为2代表的是获取数字 将数字转为时间<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[String]</b>
                </div>
                <div>
                    <textarea id="toDateInput" class="InputTextarea">2000-10-12 12:14:30</textarea>
                </div>
                <div style="padding:10px;">参数1<b>[Number]</b>：<input id="toDateCanshu1" type="text" value="1" /></div>
                <div> <input id="toDateButton" type="button" value="执行 g.toDate(String,Number)" /> </div>
                <div>
                    显示结果
                </div>
                <div>
                    <textarea id="toDateOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#toDateButton").click(function () {
                        var str1 = $('#toDateInput').val();
                        var canshu1 = $('#toDateCanshu1').val();
                        var str2 = g.toDate(str1, canshu1);
                        $('#toDateOutput').val(str2);
                    });
                </script>
            </div>
        </div>
        <div id="getCNDate" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>getCNDate</strong> </span> <span class="title-type">Function(Date/String)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                </span><span class="com">//*-------------------将时间类型转为中文字符串//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getCNDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//将时间类型转为中文字符串</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="com">//date2就是2010年01月01日00时00分00秒 星期五</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.getCNDate(Date/String)//将时间类型转为中文字符串<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="getCNDateInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div> <input id="getCNDateButton" type="button" value="执行 g.getCNDate(Date/String)" /> </div>
                <div>
                    显示结果
                </div>
                <div>
                    <textarea id="getCNDateOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#getCNDateButton").click(function () {
                        var date2 = g.toDate($('#getCNDateInput').val());
                        var str2 = g.getCNDate(date2);
                        $('#getCNDateOutput').val(str2);
                    });
                </script>
            </div>
        </div>

        <div id="format" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>format</strong> </span> <span class="title-type">Function(Date/String,String)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//*-------------------将时间转化为指定的格式---------//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span><span class="com">//将时间转化为指定的格式</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="pln">  </span><span class="com">//str1就是2010-01-01 00:00:00.0</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'MM/dd/yyyy HH:mm:ss.S'</span><span class="pun">);</span><span class="com">//将时间转化为指定的格式</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str1就是01/01/2010 00:00:00.0</span></code></li><li class="L1"><code class="lang-javascript"></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如3：</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy年MM月dd HH时mm分ss秒S毫秒'</span><span class="pun">);</span><span class="com">//将时间转化为指定的格式</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str1就是2010年01月01 00时00分00秒0毫秒</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.format(Date/String,String)//将时间转化为指定的格式<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="formatInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div style="padding:10px;">参数1<b>[String]</b>：<input id="formatCanshu1" type="text" value="yyyy-MM-dd HH:mm:ss.S" /></div>
                <div> <input id="formatButton" type="button" value="执行 g.format(Date,String)" /> </div>
                <div>
                    显示结果
                </div>
                <div>
                    <textarea id="formatOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#formatButton").click(function () {
                        var str1 = g.toDate($('#formatInput').val());
                        var canshu1 = $('#formatCanshu1').val();
                        var str2 = g.format(str1, canshu1);
                        $('#formatOutput').val(str2);
                    });
                </script>
            </div>
        </div>


        <div id="duration" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>duration</strong> </span> <span class="title-type">Function(Number,String,String)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                   </span><span class="com">//*-------------------将数字转化为时长格式 返回String类型//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                        </span><span class="com">//例如1：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                        </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">duration</span><span class="pun">(</span><span class="lit">3600</span><span class="pun">,</span><span class="pln"> </span><span class="str">'h小时'</span><span class="pun">,</span><span class="str">'s'</span><span class="pun">);</span><span class="com">// s表示秒</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="com">//str1是1小时</span></code></li><li class="L6"><code class="lang-javascript"></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                        </span><span class="com">//例如2：</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                        </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">duration</span><span class="pun">(</span><span class="lit">3600</span><span class="pun">,</span><span class="pln"> </span><span class="str">'hh:mm:ss'</span><span class="pun">,</span><span class="str">'s'</span><span class="pun">);</span><span class="com">// s表示秒</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="com">//str1是10小时1分钟</span></code></li><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                        </span><span class="com">//例如3：</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                        </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">duration</span><span class="pun">(</span><span class="lit">36060</span><span class="pun">,</span><span class="pln"> </span><span class="str">'h小时m分钟'</span><span class="pun">,</span><span class="str">'s'</span><span class="pun">);</span><span class="com">// s表示秒</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="com">//str1是01:00:00</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.duration(Number,String,String1)<br />
                    //String表示指定的格式,String1表示单位 s表示秒，m表示分钟，S表示毫秒，h表示小时，d表示天，M表示月，y表示年<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串[Number]
                </div>
                <div>
                    <textarea id="durationInput" class="InputTextarea">36060</textarea>
                </div>
                <div style="padding:10px;line-height:32px;">
                    参数1[String]：<input id="durationCanshu1" type="text" value="hh:mm:ss" /><br />
                    参数2[String1]：<input id="durationCanshu2" type="text" value="s" /><br />
                </div>
                <div>
                    <input id="durationButton" type="button" value="执行  g.duration(Number,String,Number1,Number2)" />
                </div>
                <div>
                    显示结果
                </div>
                <div>
                    <textarea id="durationOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#durationButton").click(function () {
                        var str1 = $('#durationInput').val();
                        var canshu1 = $('#durationCanshu1').val();
                        var canshu2 = $('#durationCanshu2').val();
                        var str2 = g.duration(parseFloat(str1), canshu1, canshu2);
                        $('#durationOutput').val(str2);
                    });
                </script>
            </div>
        </div>


        <div id="addDate" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>addDate</strong> </span> <span class="title-type">Function(Date/String,String,Number)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//*-------------------时间的加减---------//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="com">//时间的加减，String中y表示年，M表示月，d表示天，h表示小时，m表示分钟，s表示秒，S表示毫秒，Number表示加减量</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'y'</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间加1年</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是2011-01-01 00:00:00.0</span></code></li><li class="L9"><code class="lang-javascript"></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'y'</span><span class="pun">,</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间减去1年</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是2009-01-01 00:00:00.0</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如3：</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'d'</span><span class="pun">,</span><span class="pln"> </span><span class="lit">20</span><span class="pun">);</span><span class="com">//将时间加20天</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是2010-01-21 00:00:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.addDate(Date/String,String,Number)<br />
                    //时间的加减，String中y表示年，M表示月，d表示天，h表示小时，m表示分钟，s表示秒，S表示毫秒，Number表示加减量<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="addDateInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div style="padding:10px;">
                    参数1<b>[String]</b>：<input id="addDateCanshu1" type="text" value="y" />
                    参数2<b>[Number]</b>：<input id="addDateCanshu2" type="text" value="1" />
                </div>
                <div> <input id="addDateButton" type="button" value="执行 g.addDate(Date/String,String,Number)" /> </div>
                <div>
                    显示结果 时间中用g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="addDateOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#addDateButton").click(function () {
                        var date2 = g.toDate($('#addDateInput').val());
                        var canshu1 = $('#addDateCanshu1').val();
                        var canshu2 = parseInt($('#addDateCanshu2').val());
                        var str2 = g.addDate(date2, canshu1, canshu2);
                        $('#addDateOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="diff" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>diff</strong> </span> <span class="title-type">Function(Date/String,String,Date)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">               </span><span class="com">//*-------------------两个时间差---------//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-02-21'</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date3 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2013-06-01'</span><span class="pun">);</span><span class="pln">     </span></code></li><li class="L6"><code class="lang-javascript"></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> num1</span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">diff</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'d'</span><span class="pun">,</span><span class="pln"> date2</span><span class="pun">);</span><span class="com">//将 时间2-时间1</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">num1</span><span class="pun">);</span><span class="pln"> </span><span class="com">// num1就是51</span></code></li><li class="L1"><code class="lang-javascript"></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：    </span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> num1</span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">diff</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'y'</span><span class="pun">,</span><span class="pln"> date3</span><span class="pun">);</span><span class="com">//g.toDate('2013-06-01')与g.toDate('2010-01-01')相差几年</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">num1</span><span class="pun">);</span><span class="pln"> </span><span class="com">// num1就是3</span></code></li><li class="L6"><code class="lang-javascript"></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如3：</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> num1</span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">diff</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'M'</span><span class="pun">,</span><span class="pln"> date3</span><span class="pun">);</span><span class="com">//g.toDate('2013-06-01')与g.toDate('2010-01-01')相差几月</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">num1</span><span class="pun">);</span><span class="pln"> </span><span class="com">//  num1就是41</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.diff(Date/String,String,Date1)<br />
                    //时间的加减，String中y表示年，M表示月，d表示天，h表示小时，m表示分钟，s表示秒，S表示毫秒，Date2是Date1相差的时间（就是被减数）<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="diffInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div style="padding:10px;">
                    参数1<b>[String]</b>：<input id="diffCanshu1" type="text" value="d" />
                    参数2<b>[Date1]</b>：<input id="diffCanshu2" type="text" value="2010-02-21" />
                </div>
                <div> <input id="diffButton" type="button" value="执行 g.diff(Date/String,String,Date1)" /> </div>
                <div>
                    显示结果
                </div>
                <div>
                    <textarea id="diffOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#diffButton").click(function () {
                        var num1 = g.toDate($('#diffInput').val());
                        var canshu1 = $('#diffCanshu1').val();
                        var canshu2 = g.toDate($('#diffCanshu2').val());
                        var num1 = g.diff(num1, canshu1, canshu2);
                        $('#diffOutput').val(num1);
                    });
                </script>
            </div>
        </div>

        <div id="addMilliseconds" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>addMilliseconds</strong> </span> <span class="title-type">Function(Date/String,Number)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"><span class="pln"> </span><span class="com">//*-------------------将时间按毫秒加减---------//</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如1：</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addMilliseconds</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">100</span><span class="pun">);</span><span class="com">//将时间加1毫秒</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span><span class="pln">     </span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2010-01-01 00:00:00.100</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如2：    </span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addMilliseconds</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1000</span><span class="pun">);</span><span class="com">//将时间减去1毫秒</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2009-12-31 23:59:59.0</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如3：</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addMilliseconds</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">400</span><span class="pun">);</span><span class="com">//将时间加40毫秒</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2010-01-01 00:00:00.400</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.addMilliseconds(Date/String,Number)<br />
                    //将时间加几毫秒，Number表示加减量<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="addMillisecondsInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div style="padding:10px;">
                    参数1<b>[Number]</b>：<input id="addMillisecondsCanshu1" type="text" value="1" />
                </div>
                <div> <input id="addMillisecondsButton" type="button" value="执行 g.addMilliseconds(Date/String,Number)" /> </div>
                <div>
                    显示结果 时间中用g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="addMillisecondsOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#addMillisecondsButton").click(function () {
                        var date2 = g.toDate($('#addMillisecondsInput').val());
                        var canshu1 = parseInt($('#addMillisecondsCanshu1').val());
                        var str2 = g.addMilliseconds(date2, canshu1);
                        $('#addMillisecondsOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="addSeconds" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>addSeconds</strong> </span> <span class="title-type">Function(Date/String,Number)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"><span class="pln">   </span><span class="com">//*-------------------将时间按秒加减---------//</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如1：</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addSeconds</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">100</span><span class="pun">);</span><span class="com">//将时间加1秒</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span><span class="pln">     </span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2010-01-01 00:01:40.0</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如2：    </span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addSeconds</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1000</span><span class="pun">);</span><span class="com">//将时间减去1秒</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2009-12-31 23:43:20.0</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如3：</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addSeconds</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">400</span><span class="pun">);</span><span class="com">//将时间加40秒</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2010-01-01 00:06:40.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.addSeconds(Date/String,Number)<br />
                    //将时间加几秒，Number表示加减量<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="addSecondsInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div style="padding:10px;">
                    参数1<b>[Number]</b>：<input id="addSecondsCanshu1" type="text" value="1" />
                </div>
                <div> <input id="addSecondsButton" type="button" value="执行 g.addSeconds(Date/String,Number)" /> </div>
                <div>
                    显示结果 时间中用g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="addSecondsOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#addSecondsButton").click(function () {
                        var date2 = g.toDate($('#addSecondsInput').val());
                        var canshu1 = parseInt($('#addSecondsCanshu1').val());
                        var str2 = g.addSeconds(date2, canshu1);
                        $('#addSecondsOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="addMinutes" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>addMinutes</strong> </span> <span class="title-type">Function(Date/String,Number)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">        </span><span class="com">//*-------------------将时间按分钟加减---------//</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如1：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addMinutes</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间加1分钟</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2010-01-01 00:01:00.0</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如2：    </span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addMinutes</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间减去1分钟</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2009-12-31 23:59:00.0</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如3：</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addMinutes</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">40</span><span class="pun">);</span><span class="com">//将时间加40分钟</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2010-01-01 00:40:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.addMinutes(Date/String,Number)<br />
                    //将时间加几分钟，Number表示加减量<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="addMinutesInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div style="padding:10px;">
                    参数1<b>[Number]</b>：<input id="addMinutesCanshu1" type="text" value="1" />
                </div>
                <div> <input id="addMinutesButton" type="button" value="执行 g.addMinutes(Date/String,Number)" /> </div>
                <div>
                    显示结果 时间中用g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="addMinutesOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#addMinutesButton").click(function () {
                        var date2 = g.toDate($('#addMinutesInput').val());
                        var canshu1 = parseInt($('#addMinutesCanshu1').val());
                        var str2 = g.addMinutes(date2, canshu1);
                        $('#addMinutesOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="addHours" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>addHours</strong> </span> <span class="title-type">Function(Date/String,Number)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">           </span><span class="com">//*-------------------将时间按小时加减---------//</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如1：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addHours</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间加1小时</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2010-01-01 01:00:00.0</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如2：    </span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addHours</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间减去1小时</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2009-12-31 23:00:00.0</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">        </span><span class="com">//例如3：</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addHours</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">40</span><span class="pun">);</span><span class="com">//将时间加40小时</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2010-01-02 16:00:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.addHours(Date/String,Number)<br />
                    //将时间加几小时，Number表示加减量<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="addHoursInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div style="padding:10px;">
                    参数1<b>[Number]</b>：<input id="addHoursCanshu1" type="text" value="1" />
                </div>
                <div> <input id="addHoursButton" type="button" value="执行 g.addHours(Date/String,Number)" /> </div>
                <div>
                    显示结果 时间中用g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="addHoursOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#addHoursButton").click(function () {
                        var date2 = g.toDate($('#addHoursInput').val());
                        var canshu1 = parseInt($('#addHoursCanshu1').val());
                        var str2 = g.addHours(date2, canshu1);
                        $('#addHoursOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="addDays" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>addDays</strong> </span> <span class="title-type">Function(Date/String,Number)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">             </span><span class="com">//*-------------------将时间按天加减---------//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span><span class="pln">       </span></code></li><li class="L4"><code class="lang-javascript"></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addDays</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间加1天</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2010-01-02 00:00:00.0</span></code></li><li class="L9"><code class="lang-javascript"></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：    </span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addDays</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间减去1天</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2009-12-31 00:00:00.0</span></code></li><li class="L4"><code class="lang-javascript"></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如3：</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addDays</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">40</span><span class="pun">);</span><span class="com">//将时间加40天</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2010-02-10 00:00:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.addDays(Date/String,Number)<br />
                    //将时间加几天，Number表示加减量<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="addDaysInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div style="padding:10px;">
                    参数1<b>[Number]</b>：<input id="addDaysCanshu1" type="text" value="1" />
                </div>
                <div> <input id="addDaysButton" type="button" value="执行 g.addDays(Date/String,Number)" /> </div>
                <div>
                    显示结果 时间中用g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="addDaysOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#addDaysButton").click(function () {
                        var date2 = g.toDate($('#addDaysInput').val());
                        var canshu1 = parseInt($('#addDaysCanshu1').val());
                        var str2 = g.addDays(date2, canshu1);
                        $('#addDaysOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="addMonths" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>addMonths</strong> </span> <span class="title-type">Function(Date/String,Number)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">             </span><span class="com">//*-------------------将时间按月加减---------//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span><span class="pln">       </span></code></li><li class="L4"><code class="lang-javascript"></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addMonths</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间加1月</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2010-02-01 00:00:00.0</span></code></li><li class="L9"><code class="lang-javascript"></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：    </span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addMonths</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间减去1月</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2009-12-01 00:00:00.0</span></code></li><li class="L4"><code class="lang-javascript"></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如3：</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addMonths</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">40</span><span class="pun">);</span><span class="com">//将时间加40月</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2013-05-01 00:00:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.addMonths(Date/String,Number)<br />
                    //将时间加几月，Number表示加减量<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="addMonthsInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div style="padding:10px;">
                    参数1<b>[Number]</b>：<input id="addMonthsCanshu1" type="text" value="1" />
                </div>
                <div> <input id="addMonthsButton" type="button" value="执行 g.addMonths(Date/String,Number)" /> </div>
                <div>
                    显示结果 时间中用g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="addMonthsOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#addMonthsButton").click(function () {
                        var date2 = g.toDate($('#addMonthsInput').val());
                        var canshu1 = parseInt($('#addMonthsCanshu1').val());
                        var str2 = g.addMonths(date2, canshu1);
                        $('#addMonthsOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="addYears" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>addYears</strong> </span> <span class="title-type">Function(Date/String,Number)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">               </span><span class="com">//*-------------------将时间按年加减---------//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span><span class="pln">       </span></code></li><li class="L4"><code class="lang-javascript"></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addYears</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间加1年</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2011-02-01 00:00:00.0</span></code></li><li class="L9"><code class="lang-javascript"></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：    </span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addYears</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class="pun">);</span><span class="com">//将时间减去1年</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2009-02-01 00:00:00.0</span></code></li><li class="L4"><code class="lang-javascript"></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如3：</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">addYears</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">40</span><span class="pun">);</span><span class="com">//将时间加40年</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">,</span><span class="pln"> </span><span class="str">'yyyy-MM-dd HH:mm:ss.S'</span><span class="pun">);</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">// str2就是2050-01-01 00:00:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.addYears(Date/String,Number)<br />
                    //将时间加几年，Number表示加减量<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="addYearsInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div style="padding:10px;">
                    参数1<b>[Number]</b>：<input id="addYearsCanshu1" type="text" value="1" />
                </div>
                <div> <input id="addYearsButton" type="button" value="执行 g.addYears(Date/String,Number)" /> </div>
                <div>
                    显示结果 时间中用g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="addYearsOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#addYearsButton").click(function () {
                        var date2 = g.toDate($('#addYearsInput').val());
                        var canshu1 = parseInt($('#addYearsCanshu1').val());
                        var str2 = g.addYears(date2, canshu1);
                        $('#addYearsOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="getWeek" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>getWeek</strong> </span> <span class="title-type">Function(Date/String,String)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">             </span><span class="com">//*-------------------将时间按年加减---------//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span><span class="pln">       </span></code></li><li class="L4"><code class="lang-javascript"></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getWeek</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//将时间转化为指定的格式</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str1就是5</span></code></li><li class="L8"><code class="lang-javascript"></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：    </span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getWeek</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'CN-zhou'</span><span class="pun">);</span><span class="com">//将时间转化为指定的格式  </span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str1就是周五</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如3：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getWeek</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'CN-xingqi'</span><span class="pun">);</span><span class="com">//将时间转化为指定的格式     </span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str1就是星期五</span></code></li><li class="L6"><code class="lang-javascript"></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如4：</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getWeek</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'UK'</span><span class="pun">);</span><span class="com">//将时间转化为指定的格式  </span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str1就是Friday</span></code></li><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如5：</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getWeek</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">,</span><span class="pln"> </span><span class="str">'UK-suoxie'</span><span class="pun">);</span><span class="com">//将时间转化为指定的格式</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str1就是Fri.</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.getWeek(Date/String,String)<br />
                    //获取星期，String 有'CN-zhou','CN-xingqi','UK','UK-suoxie'<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="getWeekInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div style="padding:10px;">参数1<b>[String]</b>：<input id="getWeekCanshu1" type="text" value="CN-zhou" /></div>
                <div> <input id="getWeekButton" type="button" value="执行 g.getWeek(Date/String,String)" /> </div>
                <div>
                    显示结果
                </div>
                <div>
                    <textarea id="getWeekOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#getWeekButton").click(function () {
                        var str1 = g.toDate($('#getWeekInput').val());
                        var canshu1 = $('#getWeekCanshu1').val();
                        var str2 = g.getWeek(str1, canshu1);
                        $('#getWeekOutput').val(str2);
                    });
                </script>
            </div>
        </div>

        <div id="getQuarterStartMonth" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>getQuarterStartMonth</strong> </span> <span class="title-type">Function(Date/String)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">            </span><span class="com">//*-------------------获取一个时间在哪个季度的头一个月---------//            </span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> num1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getQuarterStartMonth</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取时间的该季度的头个月份</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">num1</span><span class="pun">);</span><span class="pln"> </span><span class="com">//num1就是1</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：    </span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-03-01'</span><span class="pun">);</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> num1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getQuarterStartMonth</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取时间的该季度的头个月份 </span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">num1</span><span class="pun">);</span><span class="pln"> </span><span class="com">// num1就是1</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如3：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-06-01'</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> num1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getQuarterStartMonth</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取时间的该季度的头个月份  </span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">num1</span><span class="pun">);</span><span class="pln"> </span><span class="com">// num1就是4</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如4：</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-12-01'</span><span class="pun">);</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> num1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getQuarterStartMonth</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取时间的该季度的头个月份</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">num1</span><span class="pun">);</span><span class="pln"> </span><span class="com">//num1就是10</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.getQuarterStartMonth(Date/String)//获取一个时间该季度的第一个月<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="getQuarterStartMonthInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div> <input id="getQuarterStartMonthButton" type="button" value="执行 g.getQuarterStartMonth(Date/String)" /> </div>
                <div>
                    显示结果
                </div>
                <div>
                    <textarea id="getQuarterStartMonthOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#getQuarterStartMonthButton").click(function () {
                        var num1 = g.toDate($('#getQuarterStartMonthInput').val());
                        var str2 = g.getQuarterStartMonth(num1);
                        $('#getQuarterStartMonthOutput').val(str2);
                    });
                </script>
            </div>
        </div>

        <div id="getWeekStartDate" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>getWeekStartDate</strong> </span> <span class="title-type">Function(Date/String)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">             </span><span class="com">//*-------------------获取一个时间在这周里的第一天（周日）时间//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getWeekStartDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这周的周日日期（周日为这周的第一天）</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2009-12-27 00:00:00.0</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-10-23'</span><span class="pun">);</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getWeekStartDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这周的周日日期（周日为这周的第一天）</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2010-10-17 00:00:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.getWeekStartDate(Date/String)<br />
                    //获取该时间这周的周日日期（周日为这周的第一天）<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="getWeekStartDateInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div> <input id="getWeekStartDateButton" type="button" value="执行 g.getWeekStartDate(Date/String)" /> </div>
                <div>
                    显示结果g.format(Date/String,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="getWeekStartDateOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#getWeekStartDateButton").click(function () {
                        var date2 = g.toDate($('#getWeekStartDateInput').val());
                        var str2 = g.getWeekStartDate(date2);
                        $('#getWeekStartDateOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="getWeekEndDate" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>getWeekEndDate</strong> </span> <span class="title-type">Function(Date/String)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">              </span><span class="com">//*-------------------获取一个时间在这周里的最后一天（周六）时间//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getWeekEndDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这周的周六日期（周六为这周的最后一天）</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2010-01-02 00:00:00.0</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-10-23'</span><span class="pun">);</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getWeekEndDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这周的周六日期（周六为这周的最后一天）</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2010-10-23 00:00:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.getWeekEndDate(Date/String)<br />
                    //获取该时间这周的周六日期（周六为这周的最后一天）<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="getWeekEndDateInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div> <input id="getWeekEndDateButton" type="button" value="执行 g.getWeekEndDate(Date/String)" /> </div>
                <div>
                    显示结果g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="getWeekEndDateOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#getWeekEndDateButton").click(function () {
                        var date2 = g.toDate($('#getWeekEndDateInput').val());
                        var str2 = g.getWeekEndDate(date2);
                        $('#getWeekEndDateOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="getMonthStartDate" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>getMonthStartDate</strong> </span> <span class="title-type">Function(Date/String)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">               </span><span class="com">//*-------------------获取一个时间在这个月的第一天//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getMonthStartDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这月的第一天</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2010-01-01 00:00:00.0</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-10-23'</span><span class="pun">);</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getMonthStartDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这月的第一天</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2010-10-01 00:00:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.getMonthStartDate(Date/String)<br />
                    //获取该时间这月的第一天<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="getMonthStartDateInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div> <input id="getMonthStartDateButton" type="button" value="执行 g.getMonthStartDate(Date/String)" /> </div>
                <div>
                    显示结果g.format(Date/String,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="getMonthStartDateOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#getMonthStartDateButton").click(function () {
                        var date2 = g.toDate($('#getMonthStartDateInput').val());
                        var str2 = g.getMonthStartDate(date2);
                        $('#getMonthStartDateOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="getMonthEndDate" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>getMonthEndDate</strong> </span> <span class="title-type">Function(Date/String)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">               </span><span class="com">//*-------------------获取一个时间在这个月的最后一天//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getMonthEndDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这个月的最后一天</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2010-01-31 00:00:00.0</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-10-23'</span><span class="pun">);</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getMonthEndDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这个月的最后一天</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2010-10-31 00:00:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.getMonthEndDate(Date/String)<br />
                    //获取该时间这个月的最后一天<br />

                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="getMonthEndDateInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div> <input id="getMonthEndDateButton" type="button" value="执行 g.getMonthEndDate(Date/String)" /> </div>
                <div>
                    显示结果g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="getMonthEndDateOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#getMonthEndDateButton").click(function () {
                        var date2 = g.toDate($('#getMonthEndDateInput').val());
                        var str2 = g.getMonthEndDate(date2);
                        $('#getMonthEndDateOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>


        <div id="getQuarterStartDate" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>getQuarterStartDate</strong> </span> <span class="title-type">Function(Date/String)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">               </span><span class="com">//*-------------------获取一个时间在这个季度的第一天//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getQuarterStartDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这个季度的第一天</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2010-01-01 00:00:00.0</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-10-23'</span><span class="pun">);</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getQuarterStartDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这个季度的第一天</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2010-10-01 00:00:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.getQuarterStartDate(Date/String)<br />
                    //获取该时间这个季度的第一天<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="getQuarterStartDateInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div> <input id="getQuarterStartDateButton" type="button" value="执行 g.getQuarterStartDate(Date/String)" /> </div>
                <div>
                    显示结果g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="getQuarterStartDateOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#getQuarterStartDateButton").click(function () {
                        var date2 = g.toDate($('#getQuarterStartDateInput').val());
                        var str2 = g.getQuarterStartDate(date2);
                        $('#getQuarterStartDateOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>

        <div id="getQuarterEndDate" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>getQuarterEndDate</strong> </span> <span class="title-type">Function(Date/String)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">               </span><span class="com">//*-------------------获取一个时间在这个季度的最后一天//</span></code></li><li class="L2"><code class="lang-javascript"></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如1：</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-01-01'</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getQuarterEndDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这季度的最后一天</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2010-03-31 00:00:00.0</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                </span><span class="com">//例如2：</span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date1 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">toDate</span><span class="pun">(</span><span class="str">'2010-10-23'</span><span class="pun">);</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> date2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">getQuarterEndDate</span><span class="pun">(</span><span class="pln">date1</span><span class="pun">);</span><span class="com">//获取该时间这季度的最后一天</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">date2</span><span class="pun">);</span><span class="com">//date2就是2010-03-31 00:00:00.0</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.getQuarterEndDate(Date/String)<br />
                    //获取该时间这季度的最后一天<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入字符串<b>[Date/String]</b> 方法自动将字符串转为时间
                </div>
                <div>
                    <textarea id="getQuarterEndDateInput" class="InputTextarea">2010-01-01</textarea>
                </div>
                <div> <input id="getQuarterEndDateButton" type="button" value="执行 g.getQuarterEndDate(Date/String)" /> </div>
                <div>
                    显示结果g.format(Date,'yyyy-MM-dd HH:mm:ss.S')
                </div>
                <div>
                    <textarea id="getQuarterEndDateOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#getQuarterEndDateButton").click(function () {
                        var date2 = g.toDate($('#getQuarterEndDateInput').val());
                        var str2 = g.getQuarterEndDate(date2);
                        $('#getQuarterEndDateOutput').val(g.format(str2, 'yyyy-MM-dd HH:mm:ss.S'));
                    });
                </script>
            </div>
        </div>



    </div>

</body>
</html>